package Util;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SendRequest {
	
	public static void sendError(String errors,String back,
			HttpServletRequest request,HttpServletResponse response)
		throws ServletException,IOException
		{
			
		request.setAttribute("errors", errors);
		request.setAttribute("back", back);
		RequestDispatcher rd = request.getRequestDispatcher("error.jsp");
		rd.forward(request, response);
		
	}
	public static void sendDispatcherForward(String url,HttpServletRequest request
			,HttpServletResponse response)
			throws ServletException,IOException
	{
		RequestDispatcher rd = request.getRequestDispatcher(url);
		rd.forward(request, response);
		
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
			

	}

}
